package com.atguigu.lease.web.app.context;

import com.atguigu.lease.model.entity.SystemUser;
import com.atguigu.lease.model.entity.UserInfo;

public class LoginUserContext {
    private static final ThreadLocal<UserInfo> threadLocal = new ThreadLocal<>();

    public static void setUser(UserInfo userInfo){
        threadLocal.set(userInfo);
    }

    public static UserInfo getUser(){
        return threadLocal.get();
    }

    public static void removeUser(){
        threadLocal.remove();
    }
}
